-- FETCH_YELLOW_WANTED_MONSTER

-- 抽取黄色通缉令目标怪物
-- @param user 玩家对象
return function(user)
    local dungeonId = DungeonM.getDungeonId();
    local parentId  = DungeonAreaM.getParentId(dungeonId);
    local arr = {};

    -- 根据当前所在的迷宫抽取
    local dungeonMonsters = {
        [1] = {  1,  6, 13, 22, 23 },
        [2] = { 24, 25, 26, 27, 28 },
        [3] = { 14, 15, 16, 17, 38 },
        [4] = { 29, 31, 43, 50, 59 },
        [5] = { 25, 26, 30, 32, 33 },
        [6] = { 13, 22, 34, 35, 36 },
        [7] = { 18, 19, 20, 37, 38, 62 },
        [8] = {  7,  8, 10, 65, 66, 67 },
        [9] = { 42, 46, 68, 69, 70, 71 },
       [10] = { 40, 72, 73, 75, 78 },
     [1001] = {  5, 26, 47, 60, 61 },
     [1002] = {  3, 10, 12, 49, 63, 64 },
     [1003] = { 6010, 6011, 6012, 6013, 6014, 6015, 6016 },
     [1004] = { 6004, 6005, 6006, 6007, 6008, 6009 },
     [1005] = { 29, 31, 43, 44, 46, 59 },
     [1006] = { 11, 39, 41, 42, 57, 58 },
    [20001] = { 613 },
    [20011] = { 616, 617, 618 },
    [20021] = { 614 },
    [20031] = { 615 },
            };

    arr = dungeonMonsters[parentId];

    if #arr == 0 then
       -- 没抽到？默认返回一只
       return 1;
    end

    local index = 1;
    if DungeonM.isInDungeon() then
        local rand = DungeonM.getRandSeed("FETCH_YELLOW_WANTED_MONSTER");
        -- 注意：客户端的下标比服务器大1
        index = rand % #arr + 1;
    else
        index = math.random(1, #arr);
    end


    return arr[index];
end

